﻿using System;

class SortThreeNumbers
{
    static void Main()
    {
        int firstNumber;
        int secondNumber;
        int thirdNumber;

        Console.WriteLine("Type first number:");
        bool isFirstNumberValid = int.TryParse(Console.ReadLine(), out firstNumber);
        Console.WriteLine("Type second number:");
        bool isSecondNumberValid = int.TryParse(Console.ReadLine(), out secondNumber);
        Console.WriteLine("Type third number:");
        bool isThirdNumberValid = int.TryParse(Console.ReadLine(), out thirdNumber);

        if (isFirstNumberValid && isSecondNumberValid && isThirdNumberValid)
        {
            int biggestNumber = 0;
            int middleNumber = 0;
            int smallestNumber = 0;

            if (firstNumber > secondNumber)
            {
                if (firstNumber>thirdNumber)
                {
                    biggestNumber = firstNumber;

                    if (secondNumber>thirdNumber)
                    {
                        middleNumber = secondNumber;
                        smallestNumber = thirdNumber;
                    }
                    else
                    {
                        middleNumber = thirdNumber;
                        smallestNumber = secondNumber;
                    }
                }
                else
                {
                    biggestNumber = thirdNumber;
                    middleNumber = firstNumber;
                    smallestNumber = secondNumber;
                }
            }
            else
            {
                if (secondNumber > thirdNumber)
                {
                    biggestNumber = secondNumber;

                    if (firstNumber > thirdNumber)
                    {
                        middleNumber = firstNumber;
                        smallestNumber = thirdNumber;
                    }
                    else
                    {
                        middleNumber = thirdNumber;
                        smallestNumber = firstNumber;
                    }
                }
                else
                {
                    biggestNumber = thirdNumber;
                    middleNumber = secondNumber;
                    smallestNumber = firstNumber;
                }
            }
            Console.WriteLine("Biggest number is {0}, middle is {1} and the smallest is {2}",biggestNumber,middleNumber,smallestNumber);
        }
        else
        {
            Console.WriteLine("Your input isn`t OK!!!");
        }
    }
}